#include <iostream>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>


using namespace std;

int main()
{
    int n=mkfifo("fifo",0666);
    if(n==-1)
    {
        perror("make fifo fail");
        exit(1);
    }

    int fd=open("fifo",O_WRONLY);

    char writebuffer[1024]="i am process A";
    write(fd,writebuffer,1024);   

    cout<<"exit"<<endl;
    sleep(5);

    unlink("fifo");

    return 0;
}